package com.google.code.b0rx0r;

import java.awt.Color;

import javax.swing.plaf.ColorUIResource;
import javax.swing.plaf.metal.MetalLookAndFeel;

public class ColorScheme {
	public static void update(MetalLookAndFeel laf) {
		KEYBOARD_BACKGROUND_COLOR = laf.getControlShadow();
		KEYBOARD_KEY_LINE_COLOR = laf.getControlTextColor();
		
		TREE_WAVEFORM_COLOR = laf.getControlShadow();
		
		SEQUENCER_SNAPPOINT_COLOR = laf.getControlShadow();
		SEQUENCER_SNAPPOINT_SNAPPED_COLOR = laf.getPrimaryControl();
		
		SEQUENCER_SEQUENCABLE_LINE_COLOR = laf.getControlTextColor();
		SEQUENCER_SEQUENCABLE_HOVERING_LINE_COLOR = laf.getControlTextColor().brighter();
		
		SEQUENCER_SEQUENCABLE_WAVEFORM_COLOR = laf.getControlShadow();
		SEQUENCER_SEQUENCABLE_TEXT_COLOR = laf.getControlTextColor();
		
		SEQUENCER_SEQUENCABLE_SNAPPOINT_COLOR = laf.getControlTextColor();
		SEQUENCER_SEQUENCABLE_SNAPPOINT_SNAPPED_COLOR = laf.getControlTextColor().brighter();
		
		SEQUENCER_BEAT_BAR_COLOR = makeTransparent(laf.getControlHighlight());
		SEQUENCER_BEAT_COLOR = makeTransparent(laf.getControlTextColor());
		
		SEQUENCER_TRACK_FILL_COLOR = laf.getControlShadow();
		SEQUENCER_TRACK_LINE_COLOR = makeTransparent(laf.getControlTextColor());
		
		SLICER_SNAPPOINT_HANDLE_PANE_BACKGROUND_COLOR = laf.getControlShadow();
		SLICER_SLICE_HANDLE_PANE_BACKGROUND_COLOR = laf.getControlShadow();
		
		SLICER_WAVEFORM_CLIPPED_BACKGROUND = laf.getControlShadow().brighter();
		
		SLICER_SLICE_HANDLE_PANE_TEXT_COLOR = laf.getControlTextColor();
		SLICER_SLICE_HANDLE_PANE_SLICE_SELECTED_LINE_COLOR = laf.getControlHighlight();
	}

	private static Color makeTransparent(ColorUIResource c) {
		return new Color(c.getRed(), c.getGreen(), c.getBlue(), 127);
	}

	public static Color DEFAULT_SLICE_COLOR = Color.decode("#DDDDDD"); //$NON-NLS-1$
	public static Color DEFAULT_SAMPLE_COLOR = Color.decode("#DDDDDD"); //$NON-NLS-1$
	public static Color DEFAULT_SEQUENCE_COLOR = Color.decode("#DDDDDD"); //$NON-NLS-1$
	
	public static Color KEYBOARD_BACKGROUND_COLOR = Color.decode("#647D8F"); //$NON-NLS-1$
	public static Color KEYBOARD_KEY_LINE_COLOR = Color.decode("#CFDCE6"); //$NON-NLS-1$
	
	public static Color TREE_WAVEFORM_COLOR = Color.decode("#222222"); //$NON-NLS-1$

	public static Color SEQUENCER_SNAPPOINT_COLOR = Color.decode("#6096BF"); //$NON-NLS-1$
	public static Color SEQUENCER_SNAPPOINT_SNAPPED_COLOR = Color.decode("#CFDCE6"); //$NON-NLS-1$

	public static Color SEQUENCER_SEQUENCABLE_LINE_COLOR = Color.decode("#CFDCE6"); //$NON-NLS-1$
	public static Color SEQUENCER_SEQUENCABLE_HOVERING_LINE_COLOR = Color.decode("#CFDCE6").brighter(); //$NON-NLS-1$
	
	public static Color SEQUENCER_SEQUENCABLE_WAVEFORM_COLOR = Color.decode("#222222"); //$NON-NLS-1$
	public static Color SEQUENCER_SEQUENCABLE_TEXT_COLOR = Color.decode("#CFDCE6"); //$NON-NLS-1$
	
	public static Color SEQUENCER_SEQUENCABLE_SNAPPOINT_COLOR = Color.decode("#6096BF"); //$NON-NLS-1$
	public static Color SEQUENCER_SEQUENCABLE_SNAPPOINT_SNAPPED_COLOR = Color.decode("#CFDCE6"); //$NON-NLS-1$
	
	public static Color SEQUENCER_BEAT_BAR_COLOR = Color.decode("#6096BF"); //$NON-NLS-1$
	public static Color SEQUENCER_BEAT_COLOR = Color.decode("#222222"); //$NON-NLS-1$
	public static Color SEQUENCER_TRACK_FILL_COLOR = Color.decode("#DDDDDD"); //$NON-NLS-1$
	public static Color SEQUENCER_TRACK_LINE_COLOR = Color.decode("#222222"); //$NON-NLS-1$
	
	public static Color SLICER_SNAPPOINT_HANDLE_PANE_BACKGROUND_COLOR = Color.decode("#DDDDDD"); //$NON-NLS-1$
	public static Color SLICER_SLICE_HANDLE_PANE_BACKGROUND_COLOR = Color.decode("#6096BF"); //$NON-NLS-1$
	public static Color SLICER_SLICE_HANDLE_PANE_TEXT_COLOR = Color.decode("#222222"); //$NON-NLS-1$
	public static Color SLICER_SLICE_HANDLE_PANE_SLICE_SELECTED_LINE_COLOR = Color.decode("#CFDCE6"); //$NON-NLS-1$
	public static Color SLICER_WAVEFORM_CLIPPED_BACKGROUND = Color.decode("#6096BF"); //$NON-NLS-1$
}
